<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Tutorial: TEST</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Tutorial: TEST</h1>

    <section>

<header>
    

    <h2>TEST</h2>
</header>

<article>
    <h1>LokiJS</h1><p><a href="http://lokijs.org">LokiJS.org web site</a> | 
<a href="https://github.com/techfort/LokiJS">LokiJS GitHub page</a> | 
<a href="https://rawgit.com/techfort/LokiJS/master/examples/sandbox/LokiSandbox.htm">Sandbox / Playground</a></p>
<h2>Documentation Overview</h2><p>This is an early effort using jsdoc to provide a more accurate and up-to-date version of LokiJS documentation.  Since modifications arise from various contributors, this should allow distributed effort toward 
maintaining this documentation.  For the time being, you can use it along with LokiJS.org documentation and the 
GitHub wiki documentation.  Ideally this will emcompass the best of both reference as well as more complete examples 
and descriptions.</p>
<h2>Getting Started</h2><p>Creating a database :</p>
<pre class="prettyprint source lang-javascript"><code>var db = new loki('example.db');</code></pre><p>Add a collection :</p>
<pre class="prettyprint source lang-javascript"><code>var users = db.addCollection('users');</code></pre><p>Insert documents :</p>
<pre class="prettyprint source lang-javascript"><code>users.insert({
    name: 'Odin',
    age: 50,
    address: 'Asgard'
});

// alternatively, insert array of documents
users.insert([{ name: 'Thor', age: 35}, { name: 'Loki', age: 30}]);</code></pre><p>Simple find query :</p>
<pre class="prettyprint source lang-javascript"><code>var results = users.find({ age: {'$gte': 35} });

var odin = users.findOne({ name:'Odin' });</code></pre><p>Simple where query :</p>
<pre class="prettyprint source lang-javascript"><code>var results = users.where(function(obj) {
    return (obj.age >= 35);
});</code></pre><p>Simple Chaining :</p>
<pre class="prettyprint source lang-javascript"><code>var results = users.chain().find({ age: {'$gte': 35} }).simplesort('name').data();</code></pre><p>Simple named transform :</p>
<pre class="prettyprint source lang-javascript"><code>users.addTransform('progeny', [
  {
    type: 'find',
    value: {
      'age': {'$lte': 40}
    }
  }
]);

var results = users.chain('progeny').data();</code></pre><p>Simple Dynamic View :</p>
<pre class="prettyprint source lang-javascript"><code>var pview = users.addDynamicView('progeny');

pview.applyFind({
    'age': {'$lte': 40}
});

pview.applySimpleSort('name');

var results = pview.data();</code></pre>
</article>

</section>

</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Collection.html">Collection</a></li><li><a href="DynamicView.html">DynamicView</a></li><li><a href="Loki.html">Loki</a></li><li><a href="LokiEventEmitter.html">LokiEventEmitter</a></li><li><a href="LokiFsAdapter.html">LokiFsAdapter</a></li><li><a href="LokiIndexedAdapter.html">LokiIndexedAdapter</a></li><li><a href="LokiLocalStorageAdapter.html">LokiLocalStorageAdapter</a></li><li><a href="Resultset.html">Resultset</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-TEST.html">TEST</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Mon Apr 04 2016 19:58:36 GMT-0400 (EDT)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>